package cn.iocoder.an.module.mold.dal.mysql.upkeeptask2item;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.upkeeptask2item.UpkeepTask2itemDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.upkeeptask2item.vo.*;

/**
 * 模具保养任务以及保养项目对照 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface UpkeepTask2itemMapper extends BaseMapperX<UpkeepTask2itemDO> {

    default PageResult<UpkeepTask2itemDO> selectPage(UpkeepTask2itemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UpkeepTask2itemDO>()
                .eqIfPresent(UpkeepTask2itemDO::getTaskId, reqVO.getTaskId())
                .eqIfPresent(UpkeepTask2itemDO::getItemId, reqVO.getItemId())
                .eqIfPresent(UpkeepTask2itemDO::getIsCompleted, reqVO.getIsCompleted())
                .betweenIfPresent(UpkeepTask2itemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UpkeepTask2itemDO::getId));
    }

}